﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取字符串型数组下标的数组长度</title>
    <script type="text/javascript" language="JavaScript">
        let info = new Array();
        info['name'] = 'jack';
        info['age'] = 24;
        let i = 0;
        for(let n in info){
            i++;
        }
        alert("总共"+i+"个元素");
    </script>
</head>
<body>

</body>
</html>